home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS Toolkit
/
BBS Toolkit.iso
/
windows
/
brk.zip
/
BRK.EXE
/
BRK.WAS
< prev
Wrap
Text File
|
1992-11-05
|
8KB
|
148 lines
;* Continually displays the status of CD, TRX, and RCV. *
;*****************************************************************************
;* *
;* BRK.WAS *
;* Copyright (C) 1992 Datastorm Technologies, Inc. *
;* All rights reserverd. *
;* *
;* Purpose: *
;* Script to display the status of received/transmitted data and the carrier *
;* detect signal. *
;* *
;* This script uses icons in the accompanying file, "BRK.ICL"; because *
;* Aspect runs at the same time as PCPLUS/Win, the script can be used during *
;* file transfers and such. Run it during an XMODEM transfer! *
;* *
;* This ASPECT SCRIPT is intended only as a sample of ASPECT programming. *
;* DATASTORM makes no warranty of any kind, express or implied, including *
;* without limitation, any warranties of merchantability and/or fitness *
;* for a particular purpose. Use of this program is at your own risk. *
;* *
;* Written by Markus Pope *
;* *
;*****************************************************************************
;*****************************************************************************
;* GLOBAL VARIABLES *
;*****************************************************************************
string Icons="brk.icl" ; Storage file for the icons
integer Pin_Trx=3,Pin_Rcv=3,Pin_Cd=3 ; Last value of the signals
integer Exit_Flag=0 ; Exit flag - when 1, script exits
;*****************************************************************************
;* MAIN *
;* This procedure is responsible for calling the dialog display routine and *
;* getting the identification of the break box window. *
;* *
;* Calls: OpenDialog(), Brkbox() *
;* Modifies Globals: none *
;*****************************************************************************
proc main
integer Win_Id=$ACTIVEWIN,Brk_Win ; Storage variables for windows
Brk_Win=OpenDialog() ; Open dialog and get window handle
activatewin Win_Id ; Activate the previous window
BrkBox(Win_Id,Brk_Win) ; Call the break box procedure and
exit ; Exit the script
endproc
;****************************************************************************
;* OPEN_DIALOG *
;* Function used to display the main dialog box; returns the handle to the *
;* calling procedure. *
;* *
;* Calls: none *
;* Modifies Globals: Pin_Trx, Pin_Rcv, Pin_Cd *
;* Returns: Pointer to BRKBOX window *
;****************************************************************************
func OpenDialog : integer ; Declare function to return integer
; Display the break box dialog box with the "off" icons.
dialogbox 2 15 103 50 7 "Break v1.0"
icon 5 6 icons pin_trx
icon 40 6 icons pin_rcv
icon 75 6 icons pin_cd
text 7 32 18 8 center "TRX"
text 42 32 18 8 center "RCV"
text 77 32 18 8 center "CD"
enddialog
return($ACTIVEWIN) ; Return handle to active window
endfunc
;****************************************************************************
;* BRK_BOX *
;* This procedure checks the transmit/receive data buffers and the carrier *
;* detect signal and updates the icons in the dialog box; the icons are *
;* located in the "BRK.ICL" file. *
;* *
;* Calls: ExitButton() *
;* Modifies Globals: Pin_Trx, Pin_Rcv, Pin_Cd *
;****************************************************************************
proc BrkBox
intparm Win_Id,Brk_Win ; Handles to main and break windows
integer TRX=0,RCV=0,CD=0,Last_Win ; State of signals and last win handle
integer Update_Flag=0 ; Set if an update is to be done
when DIALOG call ExitButton ; Flip exit flag if any dialog event
while !Exit_Flag ; Loop while the exit_flag is false
if (win_id=$ACTIVEWIN)!=Last_Win ; Check to see if the current window
if Brk_Win==Win_Id ; is the last window accessed; if so,
activatewin Last_Win ; if the new window is the brk window
endif ; reset the window to last window.
Last_Win=$ACTIVEWIN ; Set last_win to the current window
endif
if $CARRIER && !(CD) ; If CD is high and the CD icon is off,
CD=1,pin_cd=2 ; turn it on.
Update_Flag = 1 ; Set the update flag to true
elseif !($CARRIER) && CD ; If no carrier and the CD flag is set
CD=0,pin_cd=3 ; then turn off the CD icon.
Update_Flag = 1 ; Set the update flag to true
endif
if $TXCOUNT && !(TRX) ; If data is being transmitted and the
TRX=1,Pin_Trx=2 ; transmit icon is off, turn it on.
Update_Flag = 1 ; Set the update flag to true
elseif !($TXCOUNT) && TRX ; If data is not being transmitted and
TRX=0,Pin_Trx=3 ; the transmit icon is on, turn it off.
Update_Flag = 1 ; Set the update flag to true
endif
if $RXCOUNT && !(RCV) ; If data is being received and the
RCV=1,Pin_Rcv=2 ; receive icon is off, turn it on.
Update_Flag = 1 ; Set the update flag to true
elseif !($RXCOUNT) && RCV ; If data is not being received and the
RCV=0,Pin_Rcv=3 ; receive icon is on, turn it off.
Update_Flag = 1 ; Set the update flag to true
endif
if Update_Flag == 1 ; If the update flag is true, set it
Update_Flag = 0 ; to false and update the icons in the
updatedlg 2052 ; dialog box.
endif
endwhile
endproc
;****************************************************************************
;* EXIT_BUTTON *
;* This procedure sets the exit flag to true; the script will be exited, *
;* and the dialog destroyed. *
;* *
;* Calls: none *
;* Modifies globals: Exit_Flag *
;****************************************************************************
proc ExitButton
Exit_Flag=1 ; Set the exit flag to true
endproc